package com.oxy.common.util;

import java.util.Enumeration;
import java.util.Properties;

public class SystemUtil {
	public static String dumpSystemProperties() {
		StringBuffer sb = new StringBuffer();
		
		sb.append("Dump of System Properties:\r\n");
		sb.append("*********************************************\r\n");
		Properties prop = System.getProperties();
		Enumeration keys = prop.keys();
		while(keys.hasMoreElements()) {
			String k = (String)keys.nextElement();
			sb.append("["+k+"]="+prop.getProperty(k)+"\r\n");
		}
		sb.append("*********************************************");
		
		return sb.toString();
	}
	
	public static String getSystemProperties(String key) {
		String ret = System.getProperty(key);
		if(ret == null || ret.equals("")) {
			ret = null;
		}
		return ret;
	}
}
